<h4 class="h4"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>&nbsp;修改课程信息</h4>
<form class="form-horizontal" action="comm/curriculumedit.php" method="post" id="tj">
    
    <div class="form-group">
        <label for="username" class="col-sm-2 control-label">课程名称</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" id="username" placeholder="课程名称" name="cname"
                value="<?=$row['cname']?>">
        </div>
    </div>
    <div class="form-group">
        <label for="password" class="col-sm-2 control-label">课程学分</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" id="credit" placeholder="课程学分" name="credit"
                value="<?=$row['credit']?>">
        </div>
    </div>
    <div class="form-group">
        <label for="password" class="col-sm-2 control-label">课程介绍</label>
        <div class="col-sm-8">
            <textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
                name="info"><?=$row['info']?></textarea>
        </div>
    </div>
    <input type="hidden" name="id" value="<?=$row['id']?>">
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-ok"
                    aria-hidden="true"></span>&nbsp;更新
            </button>
        </div>
    </div>
</form>
<script>
    $('#tj').on('submit', function () {
        console.log(111)
        console.log($(this).serializeArray())
        if (!$(this).serializeArray()[0].value) {
            layer.msg('课程名称不能为空!', { icon: 5, time: 1000, offset: '550px', anim: 6 });
            return false;
        }
        if (!$(this).serializeArray()[1].value) {
            layer.msg('课程学分不能为空!', { icon: 5, time: 1000, offset: '550px', anim: 6 });
            return false;
        }
        if (!$(this).serializeArray()[2].value) {
            layer.msg('课程介绍不能为空!', { icon: 5, time: 1000, offset: '550px', anim: 6 });
            return false;
        }
        return true;
    })
</script>